<template>
	<view>
		<u-grid :col="2">
			<u-grid-item v-for="(item,index) in list" :key="index">
				<view>
					<image class="icon" :src="item.src">
						
					</image>
					<u-checkbox v-model="item.ischose">
						
					</u-checkbox>
				</view>
			</u-grid-item>
		</u-grid>
		<u-button type="primary" @click="back">确定</u-button>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				list:[
					{
						src:"/static/center.png",
						ischose:false
					},
					{
						src:"/static/index-selected.png",
						ischose:false
					},
					{
						src:"/static/index.png",
						ischose:false
					},
					{
						src:"/static/logo.png",
						ischose:false
					},
					{
						src:"/static/sj.png",
						ischose:false
					},
					{
						src:"/static/yz.png",
						ischose:false
					}
				]
			}
		},
		methods:{
			back(){
				let resu = []
				this.list.forEach((value,index,array)=>{
					if(value.ischose){
						resu.push(value)
					}
				})
				let pages=getCurrentPages();
				let nowPage = pages[pages.length - 1];
				let prevPage = pages[pages.length - 2];
				prevPage.$vm.chosedpic = resu;
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style>
	.icon{
		width: 100rpx;
		height: 100rpx;
	}
</style>
